home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
prodpack.zip
/
DB4PPSRC.EXE
/
HELPCTIT.PRG
< prev
next >
Wrap
Text File
|
1993-05-04
|
2KB
|
89 lines
*' $Header: $
FUNCTION HelpCTit
PARAMETERS pcMsg, pnWidth, plBar
*----------------------------------------------------------------------------
* NAME
* HelpCTit() -
*
* SYNOPSIS
* HelpCTit( pcMsg, pnWidth )
*
* DESCRIPTION
*
* PARAMETERS
* pcMsg =
* pnWidth =
* plBar = .f., use space padding; .t., use bar padding
*
* EXAMPLE
*
* LIMITATIONS
*
* DEPENDENCIES
*
* SEE ALSO
*
*----------------------------------------------------------------------------
IF plBar
cBar = CHR( 205 )
cOpen = "[" && CHR( 181 )
cClose = "]" && CHR( 198 )
ELSE
cBar = " " && CHR( 205 )
cOpen = " " && CHR( 181 )
cClose = " " && CHR( 198 )
ENDIF
cMsg = TRIM( pcMsg )
nMsgLen = LEN( cMsg )
IF MOD( nMsgLen, 2 ) = 0
cMsg = cMsg + " "
nMsgLen = nMsgLen + 1
ENDIF
cResult = ""
nHalfWid = INT( pnWidth / 2 )
nHalfMsg = INT( nMsgLen / 2 )
nPosMsg = nHalfWid - nHalfMsg + 1
nPosOpen = nPosMsg - 3
nBars = nPosOpen - 1
IF nBars > 0
cResult = REPLICATE( cBar, nBars )
ENDIF
IF nPosOpen > 0
cResult = cResult + cOpen
ENDIF
IF nPosMsg < 3
nPad = nPosMsg - 1
IF nPad > 0
cSpaces = SPACE( nPad )
ELSE
cSpaces = ""
ENDIF
ELSE
cSpaces = SPACE( 2 )
ENDIF
cResult = cResult + cSpaces + cMsg + cSpaces
IF nPosOpen > 0
cResult = cResult + cClose
ENDIF
IF nBars > 0
cResult = cResult + REPLICATE( cBar, nBars )
ENDIF
cResult = LEFT( cResult + SPACE( pnWidth ), pnWidth )
RETURN( cResult )
*-- EOF: HelpCTit( pcMsg, pnWidth )
*'----------------------------------------------------------------------------
*' $Log: $
*'----------------------------------------------------------------------------